package org.tgcloud.group.repository;

import org.apache.ibatis.annotations.Param;
import org.tgcloud.group.entity.MjBusinessPerson;
import org.tgcloud.group.web.controller.dto.businessAccount.BusinessPersonGroupByBusinessTypeDTO;
import org.tgcloud.group.web.controller.dto.home.HomeBusinessListDTO;
import org.tgcloud.group.web.controller.dto.home.HomeBusinessPerformanceListDTO;
import org.tgcloud.group.web.controller.dto.home.TotalPersonListDTO;
import org.tgcloud.group.web.controller.dto.sys.SysLabelValueListDTO;
import org.tgcloud.group.web.controller.dto.user.BusinessDTO;
import org.tgcloud.group.web.controller.dto.user.BusinessMsgDTO;

import java.util.Date;
import java.util.List;

/**
 * @Author: zhy
 * @Created: 2025-09-09-下午6:22
 * @Description: ${description}
 */
public interface MjBusinessPersonMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(MjBusinessPerson record);

    int insertSelective(MjBusinessPerson record);

    MjBusinessPerson selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(MjBusinessPerson record);

    int updateByPrimaryKey(MjBusinessPerson record);

    List<BusinessDTO> selectManageList(@Param("keyword") String keyword, @Param("status") Short status, @Param("startTime") Date startTime,
                                       @Param("endTime") Date endTime, @Param("gradeId") Integer gradeId, @Param("area") String area,
                                       @Param("businessType") Short businessType, @Param("departId") Integer departId,
                                       @Param("groupId") Integer groupId, @Param("areaId") Integer areaId

    );

    int updateStatusById(@Param("businessId") int businessId, @Param("status") Short status, @Param("departTime") Date departTime);

    int updateGroupTeamByGroupIdAndId(@Param("groupId") int groupId);

    List<SysLabelValueListDTO> selectListBySysLabelId(@Param("area") String area);

    MjBusinessPerson selectMsgByUsername(@Param("username") String username);

    BusinessMsgDTO selectMsgById(@Param("businessId") int businessId);

    Integer judgeTeam(@Param("groupId") Integer groupId);

    List<Integer> judgeTeamLeader(@Param("groupId") Integer groupId);

    int selectCountByTime(@Param("time") Date time);

    List<MjBusinessPerson> selectCountByTimeAndArea(@Param("time") Date time, @Param("area") String area);

    List<MjBusinessPerson> selectCountByTimeAndAreaId(@Param("time") Date time, @Param("areaId") Integer areaId);

    int selectCountGroup(@Param("time") Date time, @Param("groupId") Integer groupId);

    List<HomeBusinessListDTO> selectHomeListByTime(@Param("time") Date time, @Param("businessList") String[] businessArr,
                                                   @Param("area") String area, @Param("targetId") Integer targetId);

    List<TotalPersonListDTO> selectPersonListByTime(@Param("time") Date time, @Param("businessList") String[] businessArr,
                                                    @Param("area") String area);

    List<TotalPersonListDTO> selectPersonListNoTime(@Param("businessList") String[] businessArr,
                                                    @Param("area") String area);

    List<MjBusinessPerson> selectTaskListByStatus();

    MjBusinessPerson selectCountByTelephone(@Param("username") String username);

    List<MjBusinessPerson> selectAll();

    String selectUserNamesByIds(@Param("ids") String[] split);

    List<BusinessPersonGroupByBusinessTypeDTO> selectNumByBusinessType(@Param("startTime") Date startTime,
                                                                       @Param("endTime") Date endTime,
                                                                       @Param("businessType") short businessType);

    int updateRoleByBusinessId(@Param("businessId") Integer businessId, @Param("roleId") Integer roleId);

    List<HomeBusinessPerformanceListDTO> selectHomeListByArriveTime(@Param("time") Date time, @Param("businessList") String[] businessArr,
                                                                    @Param("area") String area, @Param("targetId") Integer targetId);

    int updateNoBasicSalaryAndGoodValueByBusinessId(@Param("businessId") int businessId);

    List<String> selectListByUserIdList(@Param("businessUserIdList") List<Integer> businessUserIdList);

    List<MjBusinessPerson> selectTestList();

}